﻿<UserControl x:Class="Seesmic.HelloTipi.Controls.TimeLineItemTemplate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"                 
    xmlns:utils="clr-namespace:Seesmic.Sdp.Utils;assembly=Seesmic.Sdp.Utils"
    xmlns:hellotipicontrols="clr-namespace:Seesmic.HelloTipi.Controls"
    xmlns:helpers="clr-namespace:Seesmic.HelloTipi.Helpers"
    xmlns:e="clr-namespace:Seesmic.Sdp.Utils;assembly=Seesmic.Sdp.Utils"             
    mc:Ignorable="d"
    d:DesignHeight="75" d:DesignWidth="320">

    <UserControl.Resources>
        <helpers:BoolToVisibilityReverseConverter x:Key="BoolToVisibilityReverseConverter"/>    
    </UserControl.Resources>
    
    <StackPanel Background="Transparent" Orientation="Vertical">
        <RichTextBox IsReadOnly="True" BorderBrush="Transparent" Background="Transparent" TextWrapping="Wrap">
            <Paragraph>
                <Hyperlink TextDecorations="None" Click="Username_Click">
                    <Run FontWeight="Bold" Text="{Binding Path=UsernamewithoutFamily}" />
                </Hyperlink>
                <Span utils:TextRenderer.Source="{Binding}">
                    <utils:TextRenderer.TokenDefinitions>
                        <utils:TokenDefinitionCollection>
                            <!--<utils:TokenDefinition RegexText="@([A-Za-z0-9_]+)" ProvideInlines="TokenDefinition_ProvideUsernameInlines" />-->
                            <!--<utils:TokenDefinition RegexText="#([A-Za-z0-9_]+)" ProvideInlines="TokenDefinition_ProvideHashTagInlines" />-->
                            <utils:UrlTokenDefinition />
                        </utils:TokenDefinitionCollection>
                    </utils:TextRenderer.TokenDefinitions>
                </Span>
            </Paragraph>
        </RichTextBox>

        <!--<e:MetadataControl x:Name="TimeSourceText" Margin="0,1,0,-1" VerticalAlignment="Center" Time="{Binding LocalDateTime.DateTime}" SourceLinkContent="{Binding Site.name}" SourceLinkNavigateUri="{Binding Source}" SourceLinkVisibility="Visible" IsUniversalTime="true" FontFamily="{StaticResource ApplicationFont}" Foreground="{StaticResource AttachmentForeground}" FontSize="10" />                -->

        <hellotipicontrols:HelloTipiMetaDataControl FontFamily="{StaticResource ApplicationFont}" Foreground="{StaticResource AttachmentForeground}" Time="{Binding LocalDateTime.DateTime}" Famille="{Binding Path=Site.name}" FamilleLink="{Binding Path=Source}" FamilleLinkVisibility="{Binding Path=isFamilyTimeline, Converter={StaticResource BoolToVisibilityReverseConverter}}" Margin="0,2,0,0" FontSize="10" />
<!--  -->
    </StackPanel>
</UserControl>
